package com.skymxc.wandroidtodo.page.splash;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.skymxc.wandroidtodo.data.pref.PrefUtils;
import com.skymxc.wandroidtodo.page.login.LoginActivity;
import com.skymxc.wandroidtodo.page.main.MainActivity;

/**
 * <p>
 *
 * </p>
 *
 * @author 孟祥超
 * <p>
 * date: 2021/12/1  7:04 上午
 */
public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //判断一下用户是否登陆了？
        if (PrefUtils.userIsExist()){
            Intent intent = new Intent(this, MainActivity.class);
            startActivity(intent);
        }else {
            Intent intent = new Intent(this, LoginActivity.class);
            startActivity(intent);
        }
        finish();
    }
}
